package com.aizhixin.lab.project.course.repository;

import com.aizhixin.lab.project.course.entity.ProjectDailyPaper;
import com.aizhixin.lab.project.course.entity.ProjectReply;
import com.aizhixin.lab.project.course.vo.ProjectDailyPaperVo;
import net.sf.ehcache.search.aggregator.Count;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface ProjectReplyRepository extends JpaRepository<ProjectReply,String> {
    void deleteByCreatedBy(Long userId);
    List<ProjectReply> findByProjectIdAndGroupIdAndCreatedByAndReplyObjectIdAndReplyTypeAndDeleteFlag(String project, String group, Long created,String replyObjectId,Integer replyType, Integer deleteFlag);
    List<ProjectReply> findByReleaseProjectReplyIdAndGroupIdAndCreatedByAndReplyObjectIdAndReplyTypeAndDeleteFlag(String releaseProjectReplyId, String group, Long created,String replyObjectId,Integer replyType, Integer deleteFlag);
    List<ProjectReply> findByProjectIdAndReplyObjectIdAndDeleteFlagAndCreatedBy(String project,String replyObjectId, Integer deleteFlag,Long createdBy);
    List<ProjectReply> findByReleaseProjectReplyIdAndReplyObjectIdAndDeleteFlagAndCreatedBy(String releaseProjectReplyId,String replyObjectId, Integer deleteFlag,Long createdBy);
    List<ProjectReply> findByProjectIdAndReplyObjectIdAndDeleteFlag(String project,String replyObjectId, Integer deleteFlag);
    List<ProjectReply> findByReleaseProjectReplyIdAndReplyObjectIdAndDeleteFlag(String releaseProjectReplyId,String replyObjectId, Integer deleteFlag);
    Integer countByProjectIdAndDeleteFlag(String projectId,Integer deleteFlag);
    Integer countByReleaseProjectReplyIdAndDeleteFlag(String releaseProjectReplyId,Integer deleteFlag);
    void deleteByProjectIdAndReplyObjectIdAndCreatedByAndGroupId(String projectId,String replyObjectId,Long createdBy,String groupId);
    void deleteByReleaseProjectReplyIdAndReplyObjectIdAndCreatedByAndGroupId(String releaseProjectReplyId,String replyObjectId,Long createdBy,String groupId);
}